<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="icon" type="image/x-icon" />
    <script src="static/mui.min.js"></script>
    <title>西南管道</title>
    <script>
        //浏览器上测试
        //  localStorage.setItem("baseUrl", "/api"); 

        // 设置服务器的地址
        // 正式环境
        localStorage.setItem("mirrorUrl", "http://11.100.95.1/KCMS/detail/detail.aspx?dbname=");
        localStorage.setItem("baseUrl", "http://183.242.52.85");
        // 测试调试
        // localStorage.setItem("mirrorUrl", "http://11.100.95.1/KCMS/detail/detail.aspx?dbname=");
        // localStorage.setItem("baseUrl", "http://11.100.95.119:8081");
        // 公司环境
        // localStorage.setItem("mirrorUrl", "https://61.157.227.58:8081/KCMS/detail/detail.aspx?dbname=");
        // localStorage.setItem("baseUrl", "http://61.157.227.58:8081");


        //localStorage.setItem("baseUrl", " http://localhost:8090/");

        //加入返回事件
        document.addEventListener('plusready', function() {
            var webview = plus.webview.currentWebview();
            plus.key.addEventListener('backbutton', function() {
                webview.canBack(function(e) {
                    if (e.canBack) {
                        webview.back();
                    } else {
                        //首页返回键处理
                        //处理逻辑：1秒内，连续两次按返回键，则退出应用；
                        var first = null;
                        plus.key.addEventListener('backbutton', function() {
                            //首次按键，提示‘再按一次退出应用’
                            if (!first) {
                                first = new Date().getTime();
                                setTimeout(function() {
                                    first = null;
                                }, 1000);
                            } else {
                                if (new Date().getTime() - first < 1500) {
                                    plus.runtime.quit();
                                }
                            }
                        }, false);
                    }
                })
            });
        });
        // 检测更新 
        // （1）创建异步对象
        // var ajaxObj = new XMLHttpRequest();
        // ajaxObj.open('get', window.localStorage.baseUrl + '/api/Search/GetAppVersion?type=android');
        // ajaxObj.send();
        // ajaxObj.onreadystatechange = function() {
        //     if (ajaxObj.readyState == 4 && ajaxObj.status == 200) {
        //         let ary = JSON.parse(ajaxObj.responseText);
        //         let data = JSON.parse(JSON.parse(ajaxObj.responseText).data);
        //         let obj = data[0];
        //         // 进行版本判断
        //         mui.plusReady(function() {
        //             // 获取APP版本信息 
        //             plus.runtime.getProperty(plus.runtime.appid, function(inf) {
        //                 var ver = inf.version; // 获取APP版本号 
        //                 if (Number(obj.version) > Number(inf.version)) {
        //                     plus.nativeUI.confirm("应用有新版本，是否立即下载更新？", function(event) {
        //                         if (event.index == 1) {
        //                             plus.runtime.openURL(window.localStorage.baseUrl + "/AppApk/H58D61DC9__20210521104820.apk");
        //                         }
        //                     }, 'xngd', ['取消', '确认']);
        //                 }
        //             })
        //         })
        //     }
        // }
    </script>
</head>
<style>
    .bodyClass {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 100%;
        font: inherit;
        vertical-align: baseline;
        background: #f2f2f2;
        font-size: 14px;
        color: #323232;
    }
</style>

<body class="bodyClass">
    <noscript>
    <strong>Please enable it to continue.</strong>
  </noscript>
    <div id="app">
        <div class="lds-ball">
        </div>
    </div>
    <!-- built files will be auto injected -->
</body>

<script>
    (function($) {　　
        $(".mui-scroll-wrapper").scroll({　　　　
            bounce: true, //滚动条是否有弹力默认是true
            indicators: true, //是否显示滚动条,默认是true
        });
    })(mui);

    setTimeout(function() {
        document.body.scrollTop = document.body.scrollHeight;
    }, 300);
</script>

</html>